'''
Created on 2011-10-26

@author: Administrator
'''
import os
import datetime
import Queue
stockdata_rootpath='f:\\stock2011datacenter'
rawcontentpath=os.path.join(stockdata_rootpath,'rawcontent')
errordatapath=os.path.join(stockdata_rootpath,'errorlog')
jobtodopath=os.path.join(stockdata_rootpath,'jobtodo')
stockbydatepath=os.path.join(stockdata_rootpath,'bydate')
stockfirstdate='2000/1/1'
defaultfirstdate=20000101
urlqueue=Queue.Queue()
g_jobsnumber=0
workers_number=200
threadtimeout=5
def str2date(sdate):
    return sdate
    return datetime.date(int(sdate[:4]),int(sdate[4:6]),int(sdate[6:8]))
def int2date(s):
    sdate=str(s)
    if sdate.find('/')<0 and sdate.find('-')<0 :
        return datetime.date(int(sdate[:4]),int(sdate[4:6]),int(sdate[6:8]))
    sdate=sdate.replace('/','-')
    s=[]
    s=sdate.split('-')
    return datetime.date(int(s[0]),int(s[1]),int(s[2]))
def myfloat(src):
    if len(src)==0:return 0.0
    else: return float(src)